
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/1_estimates_figure2.do" 

. /****************************************************************************
> *****************************
> Replication Files for Housing Discrimination and the Toxics Exposure Gap in t
> he United States: 
> Evidence from the Rental Market  by Peter Christensen, Ignacio Sarmiento-Barb
> ieri and Christopher Timmins
> *****************************************************************************
> ****************************/
. 
. clear all

. set matsize 11000

. 
. 
. use "../stores/ACS_population.dta"

. 
. 
. 
. gen ihs_pop=asinh(population_renters)

. 
. 
. 
. gen black=(race=="Black")

. gen hispanic=(race=="Hispanic")

. gen white=(race=="White")

. 
. 
. gen RSEI_25=(quartileZIP_property==1)

. gen RSEI_25_75=(quartileZIP_property==2 |quartileZIP_property==3)

. gen RSEI_75=(quartileZIP_property==4)

. 
. 
. xtset Zip_Code                   
       panel variable:  Zip_Code (unbalanced)

. 
. matrix define H=J(9,2,0)

. 
. xtreg ihs_pop   RSEI_25_75 RSEI_75 if white==1, fe 

Fixed-effects (within) regression               Number of obs     =      4,627
Group variable: Zip_Code                        Number of groups  =         19

R-sq:                                           Obs per group:
     within  = 0.0074                                         min =         57
     between = 0.1059                                         avg =      243.5
     overall = 0.0069                                         max =        843

                                                F(2,4606)         =      17.07
corr(u_i, Xb)  = 0.0105                         Prob > F          =     0.0000

------------------------------------------------------------------------------
     ihs_pop |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  RSEI_25_75 |  -.0286755   .0598679    -0.48   0.632    -.1460452    .0886942
     RSEI_75 |   .3207775   .0702295     4.57   0.000     .1830941    .4584608
       _cons |    4.99843   .0483828   103.31   0.000     4.903577    5.093284
-------------+----------------------------------------------------------------
     sigma_u |  .71486831
     sigma_e |   1.689115
         rho |  .15190681   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(18, 4606) = 46.00                   Prob > F = 0.0000

. matrix H[2,1] =_b[RSEI_25_75]

. matrix H[2,2] =_se[RSEI_25_75]

. 
. 
. matrix H[3,1] =_b[RSEI_75]

. matrix H[3,2] =_se[RSEI_75]

. 
. xtreg ihs_pop   RSEI_25_75 RSEI_75 if black==1, fe 

Fixed-effects (within) regression               Number of obs     =      4,627
Group variable: Zip_Code                        Number of groups  =         19

R-sq:                                           Obs per group:
     within  = 0.0303                                         min =         57
     between = 0.1453                                         avg =      243.5
     overall = 0.0184                                         max =        843

                                                F(2,4606)         =      72.00
corr(u_i, Xb)  = -0.0184                        Prob > F          =     0.0000

------------------------------------------------------------------------------
     ihs_pop |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  RSEI_25_75 |   .1156992   .0726367     1.59   0.111    -.0267035    .2581019
     RSEI_75 |   .9171235   .0852082    10.76   0.000     .7500746    1.084172
       _cons |   2.390758   .0587021    40.73   0.000     2.275674    2.505842
-------------+----------------------------------------------------------------
     sigma_u |  1.4139948
     sigma_e |  2.0493741
         rho |  .32251645   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(18, 4606) = 115.30                  Prob > F = 0.0000

. matrix H[5,1] =_b[RSEI_25_75]

. matrix H[5,2] =_se[RSEI_25_75]

. matrix H[6,1] =_b[RSEI_75]

. matrix H[6,2] =_se[RSEI_75]

. 
. xtreg ihs_pop   RSEI_25_75 RSEI_75 if hispanic==1, fe 

Fixed-effects (within) regression               Number of obs     =      4,627
Group variable: Zip_Code                        Number of groups  =         19

R-sq:                                           Obs per group:
     within  = 0.0229                                         min =         57
     between = 0.0629                                         avg =      243.5
     overall = 0.0150                                         max =        843

                                                F(2,4606)         =      53.93
corr(u_i, Xb)  = -0.0241                        Prob > F          =     0.0000

------------------------------------------------------------------------------
     ihs_pop |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  RSEI_25_75 |   .4916545   .0744554     6.60   0.000     .3456861    .6376228
     RSEI_75 |   .9027784   .0873417    10.34   0.000     .7315468     1.07401
       _cons |   1.820471   .0601719    30.25   0.000     1.702505    1.938437
-------------+----------------------------------------------------------------
     sigma_u |  1.1013373
     sigma_e |   2.100689
         rho |  .21560234   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(18, 4606) = 74.73                   Prob > F = 0.0000

. matrix H[8,1] =_b[RSEI_25_75]

. matrix H[8,2] =_se[RSEI_25_75]

. matrix H[9,1] =_b[RSEI_75]

. matrix H[9,2] =_se[RSEI_75]

. 
. 
. 
. 
. 
. preserve

. clear

. svmat H
number of observations will be reset to 9
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 9

. gen n=_n

. 
. gen race=""
(9 missing values generated)

. replace race="White" if n<=3
variable race was str1 now str5
(3 real changes made)

. replace race="Black" if n>3 & n<=6
(3 real changes made)

. replace race="Hispanic" if n>6
variable race was str5 now str8
(3 real changes made)

. 
. gen ToxConc_bin=""
(9 missing values generated)

. replace ToxConc_bin="0-25"   if n==1 | n==4 | n==7
variable ToxConc_bin was str1 now str4
(3 real changes made)

. replace ToxConc_bin="25-75"  if n==2 | n==5 | n==8
variable ToxConc_bin was str4 now str5
(3 real changes made)

. replace ToxConc_bin="75-100" if n==3 | n==6 | n==9
variable ToxConc_bin was str5 now str6
(3 real changes made)

. 
. rename H1 coef

. rename H2 std_err

. 
. save "../stores/aux/ACS_coefficients.dta", replace
(note: file ../stores/aux/ACS_coefficients.dta not found)
file ../stores/aux/ACS_coefficients.dta saved

. restore

. 
. *end
. 
end of do-file
